#define FOSC 1843200// Clock Speed
#define BAUD 9600
#define MYUBRR FOSC/16/BAUD-1

#include <avr/io.h>
#include <avr/interrupt.h>
#include "PMAR.h"
#include "PMARAction.h"
#include "PMARData.h"
#include "PMARSEMBDef.h"
#include "PMARSEMLibB.h"
#include "PMARRealLink.h"
#include "PMARSEMTypes.h"

//***********************************************************
//						USART_Init
//***********************************************************
void USART_Init (unsigned int ubrr){
	/* Set baud rate */
	UBRR0H = (unsigned char)(ubrr>>8);
	UBRR0L = (unsigned char)ubrr;
	/* Enable receiver and transmitter */
	UCSR0B = (1<<RXEN0)|(1<<TXEN0);
	/* Set frame format: 8data, 2stop bit */
	UCSR0C = (3<<UCSZ00);	
	
}

//***********************************************************
//						transmit
//***********************************************************
void RealLinkReset (void){
}


//***********************************************************
//						transmit
//***********************************************************
void RealLinkTransmit (unsigned char TXData){
	/* Wait for empty transmit buffer */
	while ( !( UCSR0A & (1<<UDRE0)) )
	;
	/* Put data into buffer, sends the data */
	UDR0 = TXData;	
}


ISR(USART0_RX_vect) {
	//VS_RealLinkReceive(UDR0);
	
}	